﻿<html><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
    
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <title></title>
<script src="/static/agent.js" type="text/javascript"></script>
<script type="text/javascript">
   var MYOA_JS_SERVER = "";
   var MYOA_STATIC_SERVER = "";
   window._td_ba && window._td_ba.server && (window._td_ba.server.guid = '{EECE1819-FDBB-39D5-EE63-FBA673A76F0C}');
</script>
<link rel="stylesheet" type="text/css" href="/static/ipanel.css"><link rel="stylesheet" type="text/css" href="/static/menu.css"></head>



<body onload="init();window.setTimeout(init, 1);" marginwidth="0" marginheight="0">
<div id="sub_tabs" class="sub_tabs">
  <ul id="sub_tabs_ul">
    <li><a id="link_1" href="javascript:view_menu(1);" title="全部菜单" class="active"><span>全部</span></a></li>
    <li><a id="link_4" href="javascript:view_menu(4);" title="收藏夹"><span>收藏</span></a></li>
</ul>
    <a id="menu_refresh" href="javascript:window.location.reload();" title="刷新该页面"></a>
    <img id="expand_link" onclick="menu_expand();" src="/static/images/green_plus.gif" title="展开/折叠菜单" style="display:;">
</div>

<div id="body" style="height: 491px;">
    <ul id="menu">
        {%for gn in gnlist%}
        <li class="L1"><a href="javascript:c('{{gn.get('SYS_CODE','')}}');" id="{{gn.get('SYS_CODE','')}}"><span><i class={{gn.get('IMAGE','')}}></i> {{gn.get('FUNC_NAME','')}}</span></a></li>
        <ul id="{{gn.get('SYS_CODE','')}}d" style="display:none;" class="U1">
        {%for gn1 in gn.get('children','')%}
        {%if '@' in gn1.get('FUNC_CODE','')%}
        <li class="L21"><a href="javascript:c('{{gn1.get('SYS_CODE','')}}');" id="{{gn1.get('SYS_CODE','')}}"><span>{{gn1.get('FUNC_NAME','')}}</span></a></li>
          <ul id="{{gn1.get('SYS_CODE','')}}d" style="display:none;background-color:#fff;">
        {%for gn2 in gn1.get('children','')%}
        <li class="L3"><a href="javascript:a('{{gn2.get('FUNC_CODE','')}}','{{gn2.get('FUNC_ID','')}}',0);" id="{{gn2.get('SYS_CODE','')}}"><span>{{gn2.get('FUNC_NAME','')}}</span></a></li>
        {%endfor%}
        </ul>
        {%else%}
        <li class="L22"><a href="javascript:a('{{gn1.get('FUNC_CODE','')}}','{{gn1.get('FUNC_ID','')}}',0);" id="{{gn1.get('SYS_CODE','')}}"><span>{{gn1.get('FUNC_NAME','')}}</span></a></li>
        {%endif%}
        {%endfor%}
        </ul>
        {%endfor%}
    
    </ul>
</div>
<div id="menu_code_1" style="display:none;"></div>
<div id="menu_code_2" style="display:none;"></div>
<div id="menu_code_3" style="display:none;"></div>
<div id="menu_code_4" style="display:none;"></div>
<div id="menu_code_5" style="display:none;"></div>
<script type="text/javascript" src="/static/utility.js"></script><script type="text/javascript" src="/static/ispirit.js"></script>
<script language="JavaScript">
function init()
{
   var bb = (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
   try{
       $("body").style.height = (bb.clientHeight - $("sub_tabs").offsetHeight) + 'px';
   }catch(e){}
}

window.onresize = (function(t){
    
    return function(){
        t && clearTimeout(t);
        t = setTimeout(init, 300);
    }
})();

var sub_menu="1";
function view_menu(id)
{
   set_current("");
   if($("menu").innerHTML.toLowerCase().indexOf("<li") >= 0)
      $("menu_code_"+sub_menu).innerText=$("menu").innerHTML;

   if($("menu_code_"+id).innerText=="" || isUndefined($("menu_code_"+id).innerText))
   {
      $("menu").innerHTML="<img src='/static/images/loading.gif' align='absMiddle'> 加载中，请稍候……";
      if(id==2) args="MENU_TYPE=SHORTCUT&OA_SUB_WINDOW=0&MENU_DISPLAY=";
      else if(id==3) args="MENU_TYPE=OA&OA_SUB_WINDOW=0";
      else if(id==4) args="MENU_TYPE=FAV&OA_SUB_WINDOW=0";
      else if(id==5) args="MENU_TYPE=FIS&OA_SUB_WINDOW=0";
      else args="OA_SUB_WINDOW=0";
      _get("menu_code.php", args, update_menu, true);
   }
   else
   {
      $("menu").innerHTML=$("menu_code_"+id).innerText;
   }
   
   $('expand_link').style.display = (id == "2" || id=="4") ? 'none' : '';
   
   if($('link_'+sub_menu))
      $('link_'+sub_menu).className="";
   
   if($('link_'+id))
      $('link_'+id).className="active";
   sub_menu=id;
   setCookie("MENU_UI_1", id);
   if(id == 5)
   {
      openURL("/t9apps/common/frame.jsp");
   }
}
function update_menu(req)
{
   if(req.status == 200)
   {
      if(req.responseText=="")
         $("menu").innerHTML="<div style='padding:10px;'>无可访问菜单</div>";
      else
      {
         $("menu").innerHTML=req.responseText;
         if(sub_menu == 2) c('mMENU_SHORTCUT');
      }
   }
   else
   {
      $("menu").innerHTML="<div style='padding:10px;'>错误："+req.status+"</div>";
   }
}

var cur_id="",cur_expand="";
var flag=0,sflag=0;

//-------- 菜单点击事件 -------
function c(id)
{
  var targetid,targetelement;
  var strbuf;

  var el=$(id);
  if(!el)
     return;
  //-------- 如果点击了展开或收缩按钮---------
  targetid=el.id+"d";
  targetelement=$(targetid);
  var expandUL=$(cur_expand+"d");
  var expandLink=$(cur_expand);
  if (targetelement.style.display=="none")
  {
     if(expandUL && expandLink && el.id.substr(0,1)=="m")
     {
        expandLink.className="";
        expandUL.style.display='none';
     }
     if(el.id.substr(0,1)=="m")
        cur_expand=el.id;
     el.className="active";
     targetelement.style.display='';

     //伸缩优化
     document.getElementById('body').scrollTop = el.offsetTop-el.clientHeight+3;

     menu_flag=0;
     if(sub_menu != '2' && sub_menu != '4')
        $("expand_link").src="/static/images/green_minus.gif";
  }
  else
  {
     el.className="";
     targetelement.style.display="none";
     menu_flag=1;
     if(sub_menu != '2' && sub_menu != '4')
        $("expand_link").src="/static/images/green_plus.gif";
     var links=document.getElementsByTagName("A");
     for (i=0; i<links.length; i++)
     {
       el=links[i];
       if(el.parentNode.className.toUpperCase()=="L1" && el.className=="active" && el.id.substr(0,1)=="m")
       {
          menu_flag=0;
          if(sub_menu != '2' && sub_menu != '4')
             $("expand_link").src="/static/images/green_minus.gif";
          break;
       }
     }
     
  }
}
//-------- 打开网址 -------
function a(URL,id,open_window)
{
   set_current(id);
   var URL2=URL; 
   
   if(URL.substr(0,7)!="http://" && URL.substr(0,6)!="ftp://")
   {
                  URL = ""+URL
          }
   if(URL2.substr(0,8)=="https://")
      URL = URL2;
   if(URL.indexOf(".") < 0 && URL.indexOf("?") < 0  && URL.indexOf("#") < 0 && URL.substring(URL.length-1) != "/")
      URL += "/";
   openURL(URL, open_window);

}
function b(URL,id,open_window)
{
   set_current(id);
   URL = "/app/"+URL;
   openURL(URL, open_window);
}
function e(URL,id,open_window)
{
   set_current(id);
   URL = "/hr/"+URL;
   openURL(URL, open_window);
}
//-------- 菜单全部展开/收缩 -------
var menu_flag=1;
function menu_expand()
{
  if(sub_menu == "2") return;
  if(menu_flag==1)
     $("expand_link").src="/static/images/green_minus.gif";
  else
     $("expand_link").src="/static/images/green_plus.gif";

  menu_flag=1-menu_flag;

  var links=document.getElementsByTagName("A");
  for (i=0; i<links.length; i++)
  {
    var el=links[i];
    if(el.parentNode.className.toUpperCase()=="L1" || el.parentNode.className.toUpperCase()=="L21")
    {
      var elUL=$(el.id+"d");
      if(menu_flag==0)
      {
        elUL.style.display='';
        el.className="active";
      }
      else
      {
        elUL.style.display="none";
        el.className="";
      }
    }
  }
}

//-------- 打开windows程序 -------
function winexe(NAME,PROG)
{
   URL="/general/winexe/?PROG="+PROG+"&NAME="+NAME;
   window.open(URL,"winexe","height=100,width=350,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0,left=0,resizable=no");}

function set_current(id)
{
   cur_link=$("f"+cur_id)
   if(cur_link)
      cur_link.className="";
   cur_link=$("f"+id);
   if(cur_link)
      cur_link.className="active";
   cur_id=id;
}

function openURL(URL, open_window)
{
    parent.openURL(URL, open_window, 1);
//    mytop=(screen.availHeight-500)/2-30;
//    myleft=(screen.availWidth-780)/2;
//    window.open(URL,"","height=500,width=780,status=0,toolbar=no,menubar=yes,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
//    window.close();

//  if(open_window==1 && 1)
//  {
//    mytop=(screen.availHeight-500)/2-30;
//    myleft=(screen.availWidth-780)/2;
//    window.open(URL,"","height=500,width=780,status=0,toolbar=no,menubar=yes,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
//    window.close();
//    
//  }
//  else
//  {
//    parent.openURL(URL, open_window, 1);
//  }
}
if(window.external && typeof window.external.OA_SMS != 'undefined')
{   
    window.external.OA_SMS('','','FRESH');
    setTimeout(function(){
        window.external.OA_SMS('','','FRESH');
    }, 500);    
}
</script>

</body>
</html>
